home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / idsdata.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.1 KB  |  87 lines

  1. /* Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: idsdata.h,v 1.2 2000/09/19 19:00:43 lpd Exp $ */
  20. /* Generic dictionary stack structure definition */
  21.  
  22. #ifndef idsdata_INCLUDED
  23. #  define idsdata_INCLUDED
  24.  
  25. #include "isdata.h"
  26.  
  27. /* Define the dictionary stack structure. */
  28. #ifndef dict_stack_DEFINED
  29. #  define dict_stack_DEFINED
  30. typedef struct dict_stack_s dict_stack_t;
  31. #endif
  32. struct dict_stack_s {
  33.  
  34.     ref_stack_t stack;        /* the actual stack of dictionaries */
  35.  
  36. /*
  37.  * Switching between Level 1 and Level 2 involves inserting and removing
  38.  * globaldict on the dictionary stack.  Instead of truly inserting and
  39.  * removing entries, we replace globaldict by a copy of systemdict in
  40.  * Level 1 mode.  min_dstack_size, the minimum number of entries, does not
  41.  * change depending on language level; the countdictstack and dictstack
  42.  * operators must take this into account.
  43.  */
  44.     uint min_size;        /* size of stack after clearing */
  45.  
  46.     int userdict_index;        /* index of userdict on stack */
  47.  
  48. /*
  49.  * Cache a value for fast checking of def operations.
  50.  * If the top entry on the dictionary stack is a writable dictionary,
  51.  * dsspace is the space of the dictionary; if it is a non-writable
  52.  * dictionary, dsspace = -1.  Then def is legal precisely if
  53.  * r_space(pvalue) <= dsspace.  Note that in order for this trick to work,
  54.  * the result of r_space must be a signed integer; some compilers treat
  55.  * enums as unsigned, probably in violation of the ANSI standard.
  56.  */
  57.     int def_space;
  58.  
  59. /*
  60.  * Cache values for fast name lookup.  If the top entry on the dictionary
  61.  * stack is a readable dictionary with packed keys, dtop_keys, dtop_npairs,
  62.  * and dtop_values are keys.value.packed, npairs, and values.value.refs
  63.  * for that dictionary; otherwise, these variables point to a dummy
  64.  * empty dictionary.
  65.  */
  66.     const ref_packed *top_keys;
  67.     uint top_npairs;
  68.     ref *top_values;
  69.  
  70. /*
  71.  * Cache a copy of the bottom entry on the stack, which is never deleted.
  72.  */
  73.     ref system_dict;
  74.  
  75. };
  76.  
  77. /*
  78.  * The top-entry pointers are recomputed after garbage collection, so we
  79.  * don't declare them as pointers.
  80.  */
  81. #define public_st_dict_stack()    /* in interp.c */\
  82.   gs_public_st_suffix_add0(st_dict_stack, dict_stack_t, "dict_stack_t",\
  83.     dict_stack_enum_ptrs, dict_stack_reloc_ptrs, st_ref_stack)
  84. #define st_dict_stack_num_ptrs st_ref_stack_num_ptrs
  85.  
  86. #endif /* idsdata_INCLUDED */
  87.